package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.CarBean;
import com.project.mapper.ICarMapper;
import com.project.service.ICarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CarServiceImpl implements ICarService {
    @Autowired
    private ICarMapper mapper;
    @Override
    public PageInfo<CarBean> findByItem(int pageNO, String type, Integer startPrice, Integer endPrice) {
        PageHelper.startPage(pageNO,3);
        PageInfo<CarBean> pageInfo = PageInfo.of(mapper.findByItem(type,startPrice,endPrice));
        return pageInfo;

    }
}
